home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Midpman / midpman.jar / midpman.class (.txt) next >
Encoding:
Java Class File  |  2001-07-26  |  1.6 KB  |  42 lines

  1. import javax.microedition.lcdui.Command;
  2. import javax.microedition.lcdui.CommandListener;
  3. import javax.microedition.lcdui.Display;
  4. import javax.microedition.lcdui.Displayable;
  5. import javax.microedition.midlet.MIDlet;
  6.  
  7. public class midpman extends MIDlet implements CommandListener {
  8.    private Command exitCommand = new Command("Exit", 1, 1);
  9.    public Command startCommand = new Command("Start", 1, 2);
  10.    public Command pauseCommand = new Command("Pause", 1, 2);
  11.    private Display display = Display.getDisplay(this);
  12.    private mmCanvas myCanvas;
  13.  
  14.    public midpman() {
  15.       this.myCanvas = new mmCanvas(this.startCommand, this.pauseCommand);
  16.    }
  17.  
  18.    public void startApp() {
  19.       this.myCanvas.addCommand(this.exitCommand);
  20.       this.myCanvas.setCommandListener(this);
  21.       this.display.setCurrent(this.myCanvas);
  22.    }
  23.  
  24.    public void pauseApp() {
  25.    }
  26.  
  27.    public void destroyApp(boolean var1) {
  28.    }
  29.  
  30.    public void commandAction(Command var1, Displayable var2) {
  31.       if (var1 == this.exitCommand) {
  32.          this.destroyApp(false);
  33.          ((MIDlet)this).notifyDestroyed();
  34.       } else if (var1 == this.startCommand) {
  35.          this.myCanvas.resume();
  36.       } else {
  37.          this.myCanvas.pause();
  38.       }
  39.  
  40.    }
  41. }
  42.